import React from "react";
import { LocaleProvider } from "antd";
import { addLocaleData, IntlProvider } from "react-intl";
import messages from "./messages";
import locale from "./zh_CN";

addLocaleData(locale.data);

export default class I18nProvider extends React.Component {

  render() {
    const { children } = this.props;
    return (
      <LocaleProvider locale={locale.antd}>
        <IntlProvider locale={locale.locale} messages={locale.messages}>
          {children}
        </IntlProvider>
      </LocaleProvider>
    );
  }
}

export { messages };
